<?php
	include_once('../Inc/Global.php');
	include_once('../anet_php_sdk/AuthorizeNet.php');
	
	require_once('../Inc/Passwords.php');
	//$creditcardnum = $_POST["creditcardnum"];
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../ECommSite/ECommCss.css" />
<!-- Tab Icon -->
<link rel="shortcut icon" href="http://mobilitysite.com/wp-content/uploads/2007/08/mlb.jpg"> 
<title><?echo $section?> Page</title>
</head>
<body>
<img src="http://www.bpsportscards.com/images/store_version1/storelogo/BP%20Cards.jpg"
	alt="BP Sports Cards" width="640" height="170" class="float" />
	<br/>
	<br/>
	<br/>
	<br/>
	<br/>
	<br/>
	<br/>
	<br/>
	<br/>
<h3>Please enter your payment information and click submit.</h3>
<table>
<tr>
<form name="creditcard" method="post">
<tr>
<td>Credit Card Number:</td>
<td><input name="creditcardnum" type="text" id="creditcardnum"></input></td>
</tr>
<tr>
<td>Expiration Date:</td>
<td><input name="expdate" type="text" id="expdate"></input></td>
</tr>
<tr>
<td><input type="submit" name="Submit" value="Submit"></input></td>
</tr>
</form>
</tr>
</table>
<input type="button" value="Cancel" onclick="window.location.href='http://cs.newpaltz.edu/~N00001387/WebClass/WebClass/ECommSite/Products.php'"/>
<?	
    //$creditcardnum = $_POST['creditcardnum'];
	if(isset($_REQUEST['Submit']))
	{
	//$creditcardnum = "$_POST['creditcardnum']";
	$transaction = new AuthorizeNetAIM($APILoginID, $TransactionKey);
	$transaction->amount = '9.99';
	$transaction->card_num = '$creditcardnum';
	echo $transaction->card_num;
	$transaction->exp_date = $_POST["expdate"];

	$response = $transaction->authorizeAndCapture();
	
	//print_r($response);
	
	if ($response->approved) 
	{
	  echo "<h1>Success! The test credit card has been charged!</h1>";
	  echo "Transaction ID: " . $response->transaction_id;
	} 
	else 
	{
	  echo $response->error_message;
	}
	
	}
?>


	
	
	